<template>
  <section class="container">
    <div style="display: flex; background: #fff">
      <img
        :src="avter"
        alt=""
        style="
          border-radius: 25px;
          width: 30px;
          height: 30px;
          margin: 10px 5% 0px 5%;
        "
      />
      <p>{{ positionName }}</p>
    </div>
    <div
      class="divp"
      style="
        height: auto;
        width: 100%;
        padding: 0px 5% 5px 5%;
        color: #8d8e8eee;
        font-size: 12px;
      "
      v-html="tiw"
    ></div>
    <div
      style="position: relative; padding-bottom: 0.1px"
      :style="{
        background: `#9081FF`,
      }"
    >
      <div class="navclas" v-if="false">
        <div
          class=""
          style="
            border-radius: 27px;
            width: 100%;
            padding: 0 10px;
            height: 29px;
            background: #fff;
          "
        >
          <div
            class="van-field__left-icon"
            style="padding-top: 5px; display: flex"
          >
            <i
              class="van-icon van-icon-search"
              style="
                height: 1.1rem;
                color: #686869;
                padding-top: 1%;
                padding-right: 2px;
              "
            ></i>
            <input
              v-model="filter_name"
              type="search"
              placeholder="输入省市名称如：南京市"
              ref="inpt"
              style="font-size: 14px"
              class="van-field__control"
              @search="filname"
            />
          </div>
        </div>
      </div>

      <van-row class="menu-container">
        <van-col span="8" style="">
          <van-dropdown-menu class="addressVa" active-color="#FFF">
            <van-dropdown-item
              :title="locaddress"
              class="select_area"
              ref="area_item"
            >
              <van-area
                columns-num="2"
                :area-list="areaList"
                @confirm="addConfirm_district"
                @cancel="hideAreaItem_district"
                :value="area_code"
              />
            </van-dropdown-item>
          </van-dropdown-menu>
        </van-col>
        <van-col span="8" style="margin: 0 10px">
          <van-dropdown-menu class="addressVa" style="margin: auto">
            <van-dropdown-item
              v-model="taskDivideId"
              :options="taskDivideOption"
              @change="handleChange"
            />
          </van-dropdown-menu>
        </van-col>

        <van-col
          @click="redirectToy('/contract/edit')"
          span="8"
          style="
            background: #ffff01;

            padding: 0;
            color: #630cea;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 25px;
          "
        >
          <b>点击发布</b>
        </van-col>
      </van-row>
    </div>
    <!-- 分隔 -->
    <div
      style="width: 100%; height: 8px; background: #ebebeb"
      v-if="controltab"
    ></div>
    <!-- tab卡 -->
    <div
      style="width: 94%; margin: auto; padding-top: 10px"
      v-if="controltab"
      ref="tabdiv"
    >
      <ul style="width: 100%; float: left; flex-wrap: wrap" ref="tabul">
        <li
          v-for="(vlu, index) in tabvlue"
          :key="vlu.id"
          style="width: 20%; float: left; border-radius: 4px; margin-top: 0px"
          :style="index % 4 != 0 ? 'margin-left: 0%' : null"
          :class="vlu.id == active ? 'getback' : 'pubak'"
          @click="ontap(index, vlu.id)"
        >
          <p style="width: 100%; text-align: center">
            <img v-lazy="vlu.img" alt="" style="width: 2rem" />
            <br />
            <span
              style="
                padding: 0px 2px;
                text-overflow: ellipsis;
                white-space: nowrap;
                overflow: hidden;
                width: 100%;
              "
              class="tanspan"
              >{{ vlu.tab }}</span
            >
          </p>
        </li>
      </ul>
    </div>
    <div style="width: 100%; background: #fff; height: 20px" v-if="controltab">
      <p style="background: #ededed; height: 8px"></p>
    </div>

    <main>
      <ul style="font-size: 14px">
        <van-list
          v-model="loading"
          :finished="finished"
          finished-text="看看其他地区万师傅在线信息"
          @load="onLoad"
        >
          <li
            class="main"
            style=""
            v-for="(item, index) in dataList"
            :key="index"
            @click="redirectTo(`/contract/detail/${item.id}`)"
          >
            <div
              class="find"
              style="
                width: 100%;
                height: 100%;
                position: relative;
                padding: 5px 0;
              "
            >
              <div style="float: left; width: 20%">
                <div>
                  <img
                    :src="touxiang(item.headPortrait, index)"
                    alt=""
                    style="
                      background-size: 100% 100%;
                      display: block;
                      width: 60px;
                      height: 60px;
                      border-radius: 50%;
                      background-repeat: no-repeat;
                    "
                  />
                </div>
              </div>
              <div class="top" style="float: left; width: 80%">
                <dt class="right">
                  <p>
                    <span
                      style="
                        display: flex;
                        width: 95%;
                        justify-content: space-between;
                      "
                    >
                      <span style="width: 60%; display: flex">
                        <b>{{ item.name }}</b>
                        <span style="color: #969799; margin-left: 7%">{{
                          item.sex && item.sex == 1 ? '男' : '女'
                        }}</span>
                        <span style="color: #969799; margin-left: 7%">{{
                          !!item.age ? item.age + '岁' : ''
                        }}</span>
                      </span>

                      <span style="font-weight: bold">{{
                        getperson(item.personnelState)
                      }}</span></span
                    >
                  </p>
                  <p
                    style=""
                    :style="
                      item.workMode != undefined ? null : 'margin-top: 10px'
                    "
                  >
                    <span>{{ item.workAge }}</span>
                  </p>
                  <p
                    style="margin-top: 1px; margin-bottom: 4px"
                    v-if="item.workMode != undefined"
                  >
                    <span style="margin-left: 0; color: #969799">
                      施工方式：{{ wrpattern(item.workMode) }}</span
                    >
                  </p>
                </dt>
                <dl class="bottom">
                  <dt>
                    <van-tag
                      size="large"
                      class="tag-blue"
                      v-for="(ite, index) in item.workType.slice(0, 3)"
                      :key="index"
                      :class="index != 0 ? 'add' : null"
                      >{{ counry(ite) }}</van-tag
                    >
                  </dt>
                </dl>
                <dl style="padding-left: 20px; width: 100%; margin-top: 3px">
                  <dt
                    style="
                      display: flex;
                      width: 100%;
                      overflow: hidden;
                      white-space: nowrap;
                      text-overflow: ellipsis;
                    "
                  >
                    <van-icon name="location" color="#34A7FF" />
                    <span
                      style="
                        margin-left: 2px;
                        overflow: hidden;
                        color: #969799;
                        white-space: nowrap;
                        text-overflow: ellipsis;
                      "
                    >
                      {{ areaqu(item.regionId) }}
                    </span>
                  </dt>
                </dl>
              </div>
              <div
                style="
                  height: 1px;
                  width: 100%;
                  background: #eeeeee;
                  position: absolute;
                  bottom: -3px;
                "
              ></div>
            </div>
            <!-- 小dmo分割线 -->
          </li>
        </van-list>
      </ul>
      <!-- <div
        style="width: 100%; text-align: center; color: gray; margin-top: 20px"
      >
        看看其他地区的工种推荐
      </div> -->
    </main>
    <main>
      <div
        style="
          width: 100%;
          text-align: center;
          font-size: 18px;
          font-weight: 600;
        "
      >
        更多推荐
      </div>
      <div style="width: 90%; margin: auto; padding-top: 10px">
        <img :src="kseh" alt="" style="width: 100%" />
      </div>
      <ul style="font-size: 14px">
        <van-list
          v-model="moreloading"
          :finished="morefinished"
          finished-text="没有更多了"
          @load="moreonLoad"
        >
          <li
            class="main"
            style=""
            v-for="(item, index) in moreList"
            :key="index"
            @click="redirectTo(`/contract/detail/${item.id}`)"
          >
            <div
              class="find"
              style="
                width: 100%;
                height: 100%;
                position: relative;
                padding: 5px 0;
              "
            >
              <div style="float: left; width: 20%">
                <div>
                  <img
                    :src="touxiang(item.headPortrait, index)"
                    alt=""
                    style="
                      background-size: 100% 100%;
                      display: block;
                      width: 60px;
                      height: 60px;
                      border-radius: 50%;
                      background-repeat: no-repeat;
                    "
                  />
                </div>
              </div>
              <div class="top" style="float: left; width: 80%">
                <dt class="right">
                  <p>
                    <span
                      style="
                        display: flex;
                        width: 95%;
                        justify-content: space-between;
                      "
                    >
                      <span style="width: 60%; display: flex">
                        <b>{{ item.name }}</b>
                        <span style="color: #969799; margin-left: 7%">{{
                          item.sex && item.sex == 1 ? '男' : '女'
                        }}</span>
                        <span style="color: #969799; margin-left: 7%">{{
                          !!item.age ? item.age + '岁' : ''
                        }}</span>
                      </span>

                      <span style="font-weight: bold">{{
                        getperson(item.personnelState)
                      }}</span></span
                    >
                  </p>
                  <p
                    style=""
                    :style="
                      item.workMode != undefined ? null : 'margin-top: 10px'
                    "
                  >
                    <span>{{ item.workAge }}</span>
                  </p>
                  <p
                    style="margin-top: 1px; margin-bottom: 4px"
                    v-if="item.workMode != undefined"
                  >
                    <span style="margin-left: 0; color: #969799">
                      施工方式：{{ wrpattern(item.workMode) }}</span
                    >
                  </p>
                </dt>
                <dl class="bottom">
                  <dt>
                    <van-tag
                      size="large"
                      class="tag-blue"
                      v-for="(ite, index) in item.workType.slice(0, 3)"
                      :key="index"
                      :class="index != 0 ? 'add' : null"
                      >{{ counry(ite) }}</van-tag
                    >
                  </dt>
                </dl>
                <dl style="padding-left: 20px; width: 100%; margin-top: 3px">
                  <dt
                    style="
                      display: flex;
                      width: 100%;
                      overflow: hidden;
                      white-space: nowrap;
                      text-overflow: ellipsis;
                    "
                  >
                    <van-icon name="location" color="#34A7FF" />
                    <span
                      style="
                        margin-left: 2px;
                        overflow: hidden;
                        color: #969799;
                        white-space: nowrap;
                        text-overflow: ellipsis;
                      "
                    >
                      {{ areaqu(item.regionId) }}
                    </span>
                  </dt>
                </dl>
              </div>
              <div
                style="
                  height: 1px;
                  width: 100%;
                  background: #eeeeee;
                  position: absolute;
                  bottom: -3px;
                "
              ></div>
            </div>
          </li>
        </van-list>
      </ul>
    </main>
    <footer></footer>
  </section>
</template>
<script>
import {
  Row,
  Col,
  Search,
  Button,
  DropdownMenu,
  DropdownItem,
  Popup,
  Area,
  List,
  Icon,
  Divider,
  Tag,
  Toast,
} from 'vant';
import sellwellsidePng from '@/assets/images/logo.jpg';
import { getLocalStorage, setLocalStorage } from '@/utils/local-storage';
import anticorrosive from '@/assets/images/protab/anticorrosive.png';
import cement from '@/assets/images/protab/cement.png';
import contactwork from '@/assets/images/contactwork.png';
import coating from '@/assets/images/protab/coating.png';
import fireproof from '@/assets/images/protab/fireproof.png';
import floor from '@/assets/images/protab/floor.png';
import gypsum from '@/assets/images/protab/gypsum.png';
import duration from '@/assets/images/protab/duration.png';
import types_of_work from '@/assets/images/protab/types_of_work.png';
import lacquer from '@/assets/images/protab/lacquer.png';
import puttyzi from '@/assets/images/protab/puttyzi.png';
import scribing from '@/assets/images/protab/scribing.png';
import waterproof from '@/assets/images/protab/waterproof.png';
import areaList from '@/views/user/module-address-edit/area_all.json';
import {
  getContractList,
  getContractDicItem,
  authInfo,
  dicItems,
  tishiP,
  adList,
  moregetContractList,
} from '@/api/api';
export default {
  name: '',
  props: {},
  data() {
    return {
      ceshi: '',
      filter_name: '',
      contactwork,
      duration,
      controltab: false,
      finished: false,
      morefinished: false,
      loading: false,
      moreloading: false,
      tiw: '',
      kseh: '',
      bei: [
        'https://xintu361.oss-cn-qingdao.aliyuncs.com/a8b9myfv9aaff9vdi8ey.jpg',
        'https://xintu361.oss-cn-qingdao.aliyuncs.com/mqes4omo1web8pbr9kfg.jpg',
        'https://xintu361.oss-cn-qingdao.aliyuncs.com/gsxkzucq38dye53ktj02.jpg',
        'https://xintu361.oss-cn-qingdao.aliyuncs.com/nw6bfr5f2j0eg1frveko.jpg',
        'https://xintu361.oss-cn-qingdao.aliyuncs.com/1fsyv5k37nl0sh5t3c07.jpg',
        'https://xintu361.oss-cn-qingdao.aliyuncs.com/2ebsg1lfh8hoc0pht53w.jpg',
      ],
      tabvlue: [
        { tab: '腻子施工', value: '建筑内外墙施工', id: 0, img: puttyzi },
        { tab: '涂料施工', value: '钢结构建筑工地', id: 2, img: coating },
        {
          tab: '防水施工',
          value: '建筑内外墙施工',
          id: 5,
          img: waterproof,
        },
        { tab: '真石漆施工', value: '建筑内外墙施工', id: 7, img: lacquer },
        { tab: '粉刷石膏', value: '建筑内外墙施工', id: 14, img: gypsum },
        { tab: '水泥砂浆', value: '家装工程防水补漏', id: 1, img: cement },
        {
          tab: '防火施工',
          value: '防腐保温工程施工',
          id: 3,
          img: fireproof,
        },
        {
          tab: '防腐施工',
          value: '建筑内外墙施工',
          id: 4,
          img: anticorrosive,
        },
        { tab: '划线施工', value: '建筑内外墙施工', id: 8, img: scribing },
        { tab: '地坪施工', value: '建筑内外墙施工', id: 12, img: floor },
        // {
        //   tab: '其他工种',
        //   value: '建筑内外墙施工',
        //   id: 13,
        //   img: types_of_work,
        // },
      ],
      value: '',
      avter: '',
      positionName: '',
      value1: 0,
      option1: [
        {
          text: '省/市选择',
          value: 0,
        },
      ],
      //工种
      taskDivideId: 0,
      taskDivideOption: [],
      //人员构成
      personMusterId: 0,
      personMusterOption: [
        {
          text: '人员构成',
          value: 0,
        },
      ],
      sellwellside: sellwellsidePng,
      page: 0,
      personneMap: new Map(),
      show: false,
      wkTypeId: 'INFO.WORK.TYPE',
      areaList: areaList,
      address: '全国地区',
      locaddress: '全国地区',
      area_code: '',
      getype: [],
      province: {
        name: '省',
        code: '100000',
      },
      city: {
        name: '市',
        code: '100000',
      },

      query: {
        //工种
        workType: 0,
        //市级区域
        regionId: '',
        //搜索查询地址
        address: '',
        region_id: '',
        //人员构成
        personnelState: '',
        page: 0,
        limit: 10,
        viewMore: 0,
      },
      dataList: [],
      memberLevel: '',
      moreList: [],
      taskDivideMap: new Map(),
      ageMap: new Map(),
      isiphoe: false,
      active: 0,
      mobile: '',
    };
  },
  created() {
    if (this.$route.query.index == undefined) {
      if (this.$route.query.controltab != undefined) {
        this.controltab = eval(this.$route.query.controltab);
      } else {
        this.controltab = true;
      }
    }
    authInfo().then((res) => {
      this.userId = res.data.data.userId;
      this.mobile = res.data.data.mobile;
      let status = res.data.data.status;
      this.positionName = res.data.data.positionName;
      this.memberLevel = res.data.data.memberLevel;
      this.avter = res.data.data.avatar;
      this.userLevel = res.data.data.userLevel;
      if (this.userLevel < 2) {
        if (this.memberLevel == 1) {
          this.positionName = '金牌会员';
        } else if (this.memberLevel == 2) {
          this.positionName = '普通会员';
        } else if (this.memberLevel == 0 && this.userLevel == 0) {
          this.positionName = '新用户';
        }
      }
    });
    setTimeout(() => {
      let tandiv = this.$refs.tabdiv;
      let tabul = this.$refs.tabul;
      tandiv.style.height = tabul.offsetHeight + 'px';
    }, 260);
    this.initArea();
    this.init();
    tishiP({ code: 'litemall_chengbao_title' }).then((res) => {
      this.tiw = res.data.data.litemall_chengbao_title;
    });
    if (getLocalStorage('taskDivideId').taskDivideId != null) {
      this.taskDivideId = Number(getLocalStorage('taskDivideId').taskDivideId);
      return;
    }
    if (this.$route.query.skill != undefined) {
      this.taskDivideId = Number(this.$route.query.skill);
      this.query.workType = this.taskDivideId;
    }
  },
  computed: {},
  methods: {
    wrpattern(tp) {
      if (tp.length == 1) {
        if (tp[0] == '0') {
          return '机器';
        } else {
          return '人工施工';
        }
      } else if (tp.length == 2) {
        return '人工施工+机器施工';
      }
    },
    counry(ite) {
      return this.taskDivideMap.get(Number(ite));
    },
    ontap(index, id) {
      this.active = id;
      this.taskDivideId = id;
      this.query.workType = id;
      this.query.page = 0;
      this.page = 0;
      this.dataList = [];
      this.moreList = [];
      this.onLoad();
      this.moreonLoad();
    },
    areaqu(code) {
      let areacode = String(code);
      let province_code = areacode.substring(0, 2) + '0000';
      let city_code = areacode.substring(0, 4) + '00';
      let province_name = areaList.province_list[province_code];
      let city_name = areaList.city_list[city_code];
      return province_name + city_name;
    },
    touxiang(item, id) {
      let img = this.bei[id % 6];
      if (item != null && item.length != 0) {
        img = item;
      }
      return img;
    },

    getperson(ite) {
      return this.personneMap.get(ite);
    },
    initArea() {
      let area = this.$store.getters.getArea;

      if (area.code != null) {
        this.area_code = area.code;
        // this.address = area.city;
      }
    },
    filname() {
      this.list = [];
      this.morelist = [];
      let ipt = this.$refs.inpt;
      ipt.blur();
      this.onLoad();
      this.moreonLoad();
    },
    redirectToy(link) {
      if (this.mobile == undefined || this.mobile == '') {
        //未认证
        Toast('请先验证手机号!');
        this.$router.push(`/check`);
        return;
      } else {
        this.$router.push({
          path: link,
        });
      }
    },
    addConfirm_district(e) {
      if (e[0].code == '100000') {
        this.city.name = '区';
      } else {
        this.province.code = e[0].code;
        this.province.name = e[0].name;
        this.city.code = e[1].code;
        this.city.name = e[1].name;
        this.locaddress = this.city.name;
        this.address = e[1].name;
        this.$refs.area_item.toggle();
        this.query.regionId = e[1].code;
        this.handleChange();
      }
      this.show = false;
    },
    hideAreaItem_district() {
      this.$refs.area_item.toggle();
      this.show = false;
    },
    showPopup() {
      this.show = true;
    },
    redirectTo(link) {
      this.$router.push({
        path: link,
      });
    },
    async init() {
      await adList({ position: 2 }).then((res) => {
        this.kseh = res.data.data.list[0].url;
      });
      //判断是否是苹果手机
      let u = navigator.userAgent;
      if (
        u.indexOf('iPhone') > -1 ||
        u.indexOf('Windows Phone') > -1 ||
        u.indexOf('iPad') > -1
      ) {
        this.isiphoe = true;
      }
      await getContractDicItem()
        .then((res) => {
          const taskDivideList = res.data.data.gozong;
          const personMusterList = res.data.data.gouchenglist;
          const ageList = res.data.data.ageList;
          let obj;
          taskDivideList.forEach((item) => {
            obj = {};
            obj['text'] = item.itemName;
            obj['value'] = Number(item.itemValue);
            // map.set()是添加设置新的键值对
            this.taskDivideMap.set(Number(item.itemValue), item.itemName);
            this.taskDivideOption.push(obj);
          });
          dicItems({
            groupId: this.wkTypeId,
          })
            .then((res) => {
              let list = res.data.data.list;

              for (let i in list) {
                let opiton = {
                  text: list[i].itemName,
                  value: parseInt(list[i].itemValue),
                };
                this.taskDivideOption.push(opiton);
              }
            })
            .catch(() => {});
          personMusterList.forEach((item) => {
            obj = {};
            obj['text'] = item.itemName;
            obj['value'] = item.itemValue;
            this.personMusterOption.push(obj);
            this.personneMap.set(Number(item.itemValue), item.itemName);
          });
          ageList.forEach((item) => {
            this.ageMap.set(item.itemValue, item.itemName);
          });
        })
        .then(() => {
          let area = this.$store.getters.getArea;
          if (area.code != null) {
            this.query.regionId = area.code;
            this.area_code = area.code;
            this.locaddress = area.city;
          } else {
            this.query.regionId = 100000;
          }
          this.onLoad();
          this.moreonLoad();
        });
    },
    onLoad() {
      if (this.query.page != 0 && this.dataList.length < 10) {
        this.query.page = 0;
        this.dataList = [];
      }
      this.query.page++;
      if (this.query.workType == '0') {
      }
      if (this.query.personnelState == '0') {
        this.query.personnelState = '';
      }
      let _obj = JSON.stringify(this.query);
      let query = JSON.parse(_obj);

      if (this.query.regionId != '' && this.query.regionId != '100000') {
        query.address = '';
      }
      getContractList(query).then((res) => {
        this.dataList.length = 0;
        let list = res.data.data.list;
        let taskDivideLis = [];
        let cityId;
        let regexp = /^[1-9]\d{5}$/;
        list.forEach((item) => {
          if (item.workType) {
            item.workType.forEach((ite) => {
              if (this.taskDivideMap.get(Number(ite))) {
                taskDivideLis.push(this.taskDivideMap.get(Number(ite)));
              }
            });
            item.taskDivideLis = taskDivideLis;
          }
          if (this.ageMap.get(item.workHour + '')) {
            item['workAge'] = this.ageMap.get(item.workHour + '') + '工龄';
          }
          cityId = item.regionId || '';
          if (regexp.test(cityId)) {
            item['cityName'] =
              this.areaList['city_list'][parseInt(cityId)] || '';
          }

          this.dataList.push(item);
        });
        this.loading = false;
        this.finished = res.data.data.page >= res.data.data.pages;
        // this.dataList = list;
      });
    },

    moreonLoad() {
      let area = this.$store.getters.getArea;

      if (this.page != 0 && this.moreList.length < 10) {
        this.moreList = [];
        this.page = 0;
      }
      this.page++;

      moregetContractList({
        workType: this.query.workType,
        regionId: this.query.regionId == '' ? area.code : this.query.regionId,
        viewMore: 1,
        limit: 10,
        page: this.page,
      }).then((res) => {
        let list = res.data.data.list;
        let taskDivideLis;
        let cityId;
        let regexp = /^[1-9]\d{5}$/;
        list.forEach((item) => {
          if (item.workType) {
            taskDivideLis = [];
            item.workType.forEach((ite) => {
              setTimeout(() => {
                if (this.taskDivideMap.get(Number(ite))) {
                  taskDivideLis.push(this.taskDivideMap.get(Number(ite)));
                }
              }, 200);
              this.getype.push(...taskDivideLis);
            });
          }

          if (this.ageMap.get(item.workHour + '')) {
            item['workAge'] = this.ageMap.get(item.workHour + '') + '工龄';
          }
          cityId = item.regionId || '';
          if (regexp.test(cityId)) {
            item['cityName'] =
              this.areaList['city_list'][parseInt(cityId)] || '';
          }
          this.moreList.push(item);
        });
        this.moreloading = false;
        this.morefinished = res.data.data.page >= res.data.data.pages;
      });
    },
    handleChange(e) {
      if (e != undefined) {
        if (e.constructor == Number) {
          this.active = e;
          setLocalStorage({ taskDivideId: e });
        } else if (e.constructor == String) {
          setLocalStorage({ personMusterId: e });
        }
      }
      this.query.workType = this.taskDivideId;
      this.query.personnelState = this.personMusterId;
      this.dataList = [];
      this.moreList = [];
      this.onLoad();
      this.moreonLoad();
    },
  },
  components: {
    [Row.name]: Row,
    [Col.name]: Col,
    [List.name]: List,
    [Search.name]: Search,
    [Button.name]: Button,
    [DropdownMenu.name]: DropdownMenu,
    [DropdownItem.name]: DropdownItem,
    [Popup.name]: Popup,
    [Area.name]: Area,
    [Icon.name]: Icon,
    [Divider.name]: Divider,
    [Tag.name]: Tag,
  },
};
</script>
<style lang='scss' scoped>
.van-tag--large {
  font-size: 12px !important;
  padding: 2px 4px !important;
}
/deep/.van-icon-location::before {
  padding: 2px;
}
.navclas {
  display: flex;
  height: 50px;
  padding: 0 16px;
  padding-top: 11px;
  box-sizing: border-box;

  > a {
    border: 1px solid #0397fb;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  /deep/ .van-dropdown-menu__title {
    color: black !important;
  }
  /deep/ .van-dropdown-menu__title::after {
    border-color: transparent transparent black black !important;
  }
  /deep/.van-dropdown-menu__bar {
    background-color: #2aa7ea00 !important;
  }
}
.menu-container {
  display: flex;
  margin: 0 0 0px 0;

  .van-col {
    flex: 1 !important;
    // padding: 0 5px;
  }

  /deep/.van-dropdown-menu__bar {
    height: auto;
    background: #9d90ff;
    border-radius: 25px;
    .van-dropdown-menu__title::after {
      border-color: transparent transparent #fff #fff;
    }
  }
  /deep/ .van-dropdown-menu__title {
    color: #fff;
  }

  /deep/ .van-dropdown-menu {
    box-shadow: 0 0 0 0;
    background: none;

    .van-dropdown-menu__item {
      // margin-left: 6px;
      padding: 0 3% 0 0;
      height: 29px;
      border-radius: 4px;
    }
  }
}
nav {
  display: flex;

  font-weight: bolder;
  padding: 10px 16px 0 16px;

  box-sizing: border-box;
  border-radius: 4px;

  > a {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .is-active {
    color: #630cea;
    background-color: #fff;
  }
}
.add {
  margin-left: 4px;
}
/deep/ .van-field__body {
  padding-right: 8px !important;
}
.container {
  //width: 100vw;
  //height: 100vh;
  background-color: white;

  .van-row {
    padding: 10px 10px;

    .van-row {
      padding: 0px;
    }
  }

  .van-search__content--round {
    border-radius: 0px !important;
  }

  .van-search__content {
    background: rgba(0, 0, 0, 0);
  }

  .van-search {
    padding: 0px;
    height: 24px !important;
  }
  .getback {
    color: #018dff;
    background: #f0f7fa;
    .tanspan {
      // font-weight: bold;
      font-size: 11.2px;
    }
    // .valuespan {
    //   font-size: 0.52rem;
    // }
  }
  .pubak {
    // background: #ededed;
    .tanspan {
      font-size: 11px;
    }
    // .valuespan {
    //   font-size: 0.5rem;
    // }
  }

  .van-cell {
    padding: 0px;
  }

  .cell-span {
    color: #969799;
    font-size: 12px;
  }

  .publish {
    line-height: 40px;
    text-align: end;
  }
  .publish span {
    // height: 30px;
    background-color: #ee3f00;
    border: 1px solid #ee3f00;
    border-radius: 4px;
    font-size: 14px;
    padding: 5px 7px;
    color: white;
  }

  > nav {
    display: flex;
    height: 40px;
    background-color: white;
    font-weight: bolder;
    margin: 10px 16px 0 16px;
    // border: 1px solid #1d5ae8;
    box-sizing: border-box;
    border-radius: 4px;

    > a {
      flex: 1;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .is-active {
      color: white;
      background-color: #1d5ae8;
    }
  }

  .context-container {
    width: 80%;
    border-radius: 4px;
    background-color: #ee460a;
    color: white;
    font-size: 14px;
    padding: 0 5px;
    height: 27.2px;
    line-height: 22px;

    display: flex;
    align-items: center;
    justify-content: center;

    > span {
      transform: translateY(1px);
    }
  }
  > .left {
    // background: blue;
    margin-top: 3px;
  }

  main {
    // margin-top: 15px;
    flex: 1;

    > ul {
      padding: 0 15px;

      .main {
        width: 100%;
        //min-height: 220px;
        // margin-bottom: 11px;
        // box-shadow: 0 0 15px rgba(161, 161, 161, 0.2);
        border-radius: 2px;
        display: flex;
        padding-top: 10px;
        padding-left: 10px;
        position: relative;

        border-radius: 2px;

        dl {
          margin: 0;
          margin-block-start: 0;
          margin-block-end: 0;
        }

        .top {
          display: flex;
          flex-direction: column;
          font-size: 12px;

          .circle {
            // border: 1px solid;
            background-size: 100% 100%;
            display: block;
            width: 60px;
            height: 60px;
            border-radius: 50%;
            background-repeat: no-repeat;
          }

          .right {
            flex: 1;
            flex-direction: column;
            font-size: 14px;

            p {
              padding: 0 0 0 20px;
              margin: 0;
              align-items: center;
              height: 33%;
            }
            p:nth-of-type(2) {
              color: rgb(150, 151, 153);
            }
            p:nth-of-type(1),
            p:nth-of-type(2) {
              white-space: normal;

              > span:not(:nth-of-type(1)) {
                margin-left: 10px;
                //visibility: hidden;
              }
            }

            p:nth-of-type(1) {
              > span:nth-of-type(3) {
                margin: 0 auto !important;
              }
            }
          }
        }

        .bottom {
          display: flex;
          flex-direction: column;
          margin: 5px 0;
          padding-left: 20px;
          white-space: nowrap;
          overflow: hidden;
          text-overflow: ellipsis;
          > nav {
            flex: 1;
            //justify-content: center;
          }

          > nav:nth-of-type(1) {
            flex: 1;
            display: flex;
            //align-items: center;

            > nav {
              font-size: 13px;
              // font-weight: bold;

              //transform: translateY(-50%);
              > span {
                margin: 5px 10px 5px 0;
                background-color: #eeeeee;
                //float: left;
                //padding: 2px 5px;
                padding: 3px 5px 2px 5px;
                //font-weight: bolder;
              }

              > span.is-active {
                background-color: #ed3f00;
                color: white;
              }
            }
          }
        }

        .show-more {
          height: 30px;
          text-align: center;

          > span {
            background-color: #ed3f00;
            padding: 3px 10px;
            border-radius: 30px;
            color: white;
            line-height: 30px;
          }
        }

        .line {
          border-color: rgba(34, 34, 34, 0.2);
          margin: 8px 0 3px 0 !important;
        }

        .address {
          // line-height: 30px;
          //margin-top: 5px;
          color: rgba(34, 34, 34, 0.3);
          display: flex;
          font-size: 12px;
          // font-weight: bold;

          > div:nth-of-type(1) {
            flex: 1;
            text-align: left;
          }

          > div:nth-of-type(2) {
            flex: 1.5;
            text-align: right;

            a {
              color: inherit;
            }
          }
        }
      }
    }
  }
}
</style>
